3 Building in Mac OS X can be accomplished in just a few steps:
5 * Install general development tools (clang, make, git)
6 * Install ARM GCC 7.2 series compiler or higher
7 * Checkout INAV sourcecode through git
10 ## Install general development tools (clang, make, git)
12 Open up a terminal and run `make`. If it is installed already, you should see a message like this, which means that you
13 already have the required development tools installed:
16 make: *** No targets specified and no makefile found. Stop.
19 If it isn't installed yet, you might get a popup like this. If so, click the "install" button to install the commandline
22 ![Prompt to install developer tools](assets/mac-prompt-tools-install.png)
24 If you just get an error like this instead of a helpful popup prompt:
27 -bash: make: command not found
30 Try running `xcode-select --install` instead to trigger the popup.
32 If that doesn't work, you'll need to install the XCode development environment [from the App Store][]. After
33 installation, open up XCode and enter its preferences menu. Go to the "downloads" tab and install the
34 "command line tools" package.
36 [from the App Store]: https://itunes.apple.com/us/app/xcode/id497799835
38 ## Install ARM GCC 7.2 series or higher compiler
40 INAV is built using series 7.2 or above GCC compiler provided by the [GNU Tools for ARM Embedded Processors project][].
42 Grab the Mac installation tarball for the latest version in the 7.2 series or above (e.g. gcc-arm-none-eabi-7-2017-q4-major-mac.tar.bz2). Move it somewhere useful
43 such as a `~/development` folder (in your home directory) and double click it to unpack it. You should end up with a
44 folder with a name similar to `~/development/gcc-arm-none-eabi-7-2017-q4-major/`.
46 Now you just need to add the `bin/` directory from inside the GCC directory to your system's path. Run `nano ~/.profile`. Add a
47 new line at the end of the file which adds the path for the `bin/` folder to your path, like so:
50 export PATH=$PATH:~/development/gcc-arm-none-eabi-7-2017-q4-major/bin
53 Press CTRL+X to exit nano, and answer "y" when prompted to save your changes.
55 Now *close this terminal window* and open a new one. Try running:
58 arm-none-eabi-gcc --version
61 You should get output similar to (in this example compiler series 7.2.1 is used):
64 arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204]
65 Copyright (C) 2017 Free Software Foundation, Inc.
66 This is free software; see the source for copying conditions. There is NO
67 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
70 If `arm-none-eabi-gcc` couldn't be found, go back and check that you entered the correct path in your `~/.profile` file.
72 [GNU Tools for ARM Embedded Processors project]: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
76 Ruby is installed by default on macOS.
78 ## Checkout INAV sourcecode through git
80 Enter your development directory and clone the [INAV repository][] using the "HTTPS clone URL" which is shown on
81 the right side of the INAV GitHub page, like so:
84 git clone https://github.com/iNavFlight/inav
87 This will download the entire INAV repository for you into a new folder called "inav".
89 [INAV repository]: https://github.com/iNavFlight/inav.git
93 Enter the inav directory and run `make TARGET=SPRACINGF3` to build firmware for the SPRacing F3. When the build completes,
94 the .hex firmware should be available as `obj/inav_x.x.x_SPRACINGF3.hex` for you to flash using the INAV
97 ## Updating to the latest source
99 If you want to erase your local changes and update to the latest version of the INAV source, enter your
100 inav directory and run these commands to first erase your local changes, fetch and merge the latest
101 changes from the repository, then rebuild the firmware:
107 make clean TARGET=SPRACINGF3
108 make TARGET=SPRACINGF3